<?php

class Vertex {
	protected $id;
	protected $degree = 0;
	protected $color = 0;
	protected $coloredNeighbours = 0;
	protected $neighbours = array();
	
	public function __construct($id) {
		$this->id = $id;
	}
	
	public function getId() {
		return $this->id;
	}
	
	public function addNeighbour(Vertex $vertex) {
		if (!in_array($vertex->getId(), $this->getNeighbours()))	{
			$this->neighbours[] = $vertex->getId();
			$this->degree++;
		}
	}
	
	public function setColor($color) {
		$this->color = $color;
		// throw new Exception("Niekde je to este zle, treba pouzit funkciu grafu nie priamo vrcholu");
	}
	
	public function getNeighbours() {
		return $this->neighbours;
	}
	
	public function getDegree() {
		return $this->degree;
	}
	
	public function getColor() {
		return $this->color;
	}
	
	public function addColoredNeighbour() {
		$this->coloredNeighbours++;
	}
	
	public function removeColoredNeighbour() {
		$this->coloredNeighbours--;
	}
	
	public function getColoredNeighbours() {
		return $this->coloredNeighbours;
	}
}

?>